package com.example.demo.entity;

import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.util.Date;

@Data
@MappedSuperclass
@DynamicInsert
@DynamicUpdate
public class BaseEntity {

    @Id
    @Column(name = "id")
    private Long id;

    @Column(name = "insert_operator_id")
    private Long insertOperatorId;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "insert_time")
    private Date insertTime;

    @Column(name = "update_operator_id")
    private Long updateOperatorId;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "update_time")
    private Date updateTime;
}
